home *** CD-ROM | disk | FTP | other *** search
- /* new - mallocs any sized type */
- #ifndef lint
- #define new(t) (t *)mylib_malloc(sizeof(t),__FILE__,__LINE__)
- #else
- #define new(t) (t *)NULL
- #endif
-
- /* mem - mallocs a given number of bytes */
- #define mem(l) mylib_malloc((unsigned)l,__FILE__,__LINE__)
-
- /* rmem - reallocs a given number of bytes */
- #define rmem(c,l) mylib_realloc(c,(unsigned)l,__FILE__,__LINE__)
-
- /* s - returns a copy of a given string */
- #define s(c) mylib_scopy(c,__FILE__,__LINE__)
-
- /* rs - returns a copy of the second string in place of the first string,
- using realloc */
- #define rs(c,d) mylib_srcopy(c,strlen(d),__FILE__,__LINE__)
-
- /* assert - error message if statement is false */
- #ifdef DEBUG
- #define assert(c) if(!(c))(void)fprintf(stderr,"%s: %d: Assert false\n",__FILE__,__LINE__)
- #else
- #define assert(c) 0
- #endif
-
- /* STREQ - indicate whether two strings are equal */
- #define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0)
-
- #define loop for(;;)
- #define NUL(x) (x)NULL
- #ifndef TRUE
- #define TRUE 1
- #endif
- #ifndef FALSE
- #define FALSE 0
- #endif
- #define YES 1
- #define NO 0
-
- /* Error - print like fprintf(stderr, ...) and die. Progname included at
- beginning of message, newline at end. */
- extern void Error();
- /* Warning - like error, without dying */
- extern void Warning();
-
- extern char *mylib_malloc();
- extern char *mylib_realloc();
- extern char *mylib_scopy();
- extern char *mylib_srcopy();
- extern char *cat();
- extern char *getstr();
- extern FILE *efopen();
- extern void efclose();
- extern void dfprintf();
-
- extern char *progname; /* application's name. Used by Error, Warning. */
- extern int d; /* debug level */
-